<?php
/**
 * Patient 
 * Display a form with patient required fields.
 *
 * @author Xavier VILAIN
 * @package Nawa\MedicalStudy\MedicalCenter\Patient
 * @license
 *
 */
use Fox\Html\DropList,Fox\Html\Input;
use Fox\Html\Block;
use Fox\Dao\SqlFragment;
use Nawa\MedicalStudy\MedicalCenter\Patient;
use Nawa\MedicalStudy\MedicalCenter\Patient\Status;

$inline = !empty($params['inline']) ? $params['inline'] : null;
$block = new Block('bAddPatient',Msg(Fox\Msg::BUNDLE,Fox\Msg::MSG_MASTER_DATA));
if(!$inline) {
	$block->noLegend();
	$column = null;
} else {
	$column = 2;
}

$block->add(new Input(array('patient_ref','reference'),true));
//$block->add(new Input('initials',false),$column);
$block->add(new Input('birth_date',false));
//$block->add(new DropList('gender',true),$column);
$block->add(new Input('selection_date',false));
//$block->add(new Input('inclusion_date',false),$column);
// Handle Patients Status
$finder = new Status();
$block->add(new DropList('status',false,false,true,Patient::STATUS_INCLUDED))
->options($finder->find(new SqlFragment('disable = ?',array(0))),'status','label');

return $block;